<?php
// 9/10/2009: Immanuel192 write this function 
// this function will return HTML contain button add to cart

function smarty_function_add_to_cart($params, &$smarty)
{
    $temp=array(
        'action'=>'price_list',
        'module'=>'storemodule');
    
    if (isset($params['name']))
      $name = $params['name'];
	else $name='';
	//
    $i18n=exponent_lang_loadFile("plugins/function_add_to_cart.php");
    
	if ($name !='')
		$name=$i18n['buy_title'].$name;
	else $name=$i18n['buy_this'];
	
	if (isset($params['notitle'])) $name='';

    $link = exponent_core_makeLink($temp);
    if (isset($params['id']))
      $link.="#album_".$params['id'];
    // label
    if (isset($params['label']))
      {
       $html="<a class='order_icon' style='color: #000000;' href='{$link}' title='{$name}' >{$i18n['label']}</a>";
      }
    else {
      $html="<a style='padding-bottom: 3px;' href='{$link}' title='{$name}' alt=''>
      <img src='".THEME_RELATIVE."modules/storemodule/images/cart.png' border=0></a>";
    }
    return $html;
}
?>
